import { IsString, IsOptional, IsBoolean, IsUUID } from 'class-validator';
import { ApiPropertyOptional } from '@nestjs/swagger';
import { PaginationDto } from '../../../common/dto/pagination.dto';

export class QueryFileDto extends PaginationDto {
  @ApiPropertyOptional({ description: '原始文件名搜索' })
  @IsOptional()
  @IsString({ message: '原始文件名必须是字符串' })
  originalName?: string;

  @ApiPropertyOptional({ description: '是否公开访问' })
  @IsOptional()
  @IsBoolean({ message: '是否公开访问必须是布尔值' })
  isPublic?: boolean;

  @ApiPropertyOptional({ description: '上传者ID' })
  @IsOptional()
  @IsUUID('4', { message: '上传者ID格式不正确' })
  uploaderId?: string;
}
